home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Utilities
/
Text Processing
/
Alpha
/
Tcl
/
Modes
/
latexMenu.tcl
< prev
next >
Wrap
Text File
|
1997-03-31
|
27KB
|
1,262 lines
#############################################################################
#############################################################################
#
# latexMenu.tcl (called from latex.tcl)
#
# LaTeX menu definitions and key bindings
#
#############################################################################
#
# Author: Tom Scavo <trscavo@syr.edu>
#
#############################################################################
#############################################################################
# The highest level menu macro, to be called initially or whenever
# the LaTeX menu must be rebuilt (as in 'shadowtexSig' in latex.tcl,
# or 'toggleLaTeXMenus' below):
proc buildLaTeXMenu {} {
global texSig texAppSig latexMenu
global useShortLaTeXMenu
global modifiedModeMenus
set texAppMenuID(OzTeX) "•266"
set texAppMenuID(Textures) "•267"
set texAppMenuID(CMacTeX) "•272"
# set texAppMenuID(CMacTeX) "•273"
set texAppMenuID(DirectTeXPro) "•299"
if { [info exists texSig] && $texSig != "" } {
set supportedApps [array names texAppMenuID]
foreach app $supportedApps {
if { $texAppSig($app) == $texSig } {
set latexMenu $texAppMenuID($app)
break
}
}
}
menu -M TeX -n $latexMenu -m -p latexHelp [getLaTeXMenu]
markMenuItem {LaTeX Utilities} {Short LaTeX Menu} $useShortLaTeXMenu
lappend modifiedModeMenus TeX
return
}
# Invoked by choosing "Short LaTeX Menu" on the "LaTeX Utilities" submenu:
proc toggleLaTeXMenus {} {
global useShortLaTeXMenu modifiedVars
watchCursor
set useShortLaTeXMenu [expr 1 - $useShortLaTeXMenu]
lappend modifiedVars useShortLaTeXMenu
message {Rebuilding LaTeX menu…}
buildLaTeXMenu
message ""
}
# Return a short menu or a long menu, depending on the value of
# the global variable 'useShortLaTeXMenu':
proc getLaTeXMenu {} {
global useShortLaTeXMenu
if {$useShortLaTeXMenu} {
return [concat \
[getLaTeXCommands] \
{{(-}} \
[getTextSubsubmenus] \
{{(-}} \
[getMathSubsubmenus] \
]
} else {
return [concat \
[getLaTeXCommands] \
{{(-}} \
[getTextSubmenus] \
{{(-}} \
[getMathSubmenus] \
]
}
}
# Return generic LaTeX commands common to both menus:
proc getLaTeXCommands {} {
return [list \
[typesetSubmenu] \
[gotoSubmenu] \
[latexUtilitiesSubmenu] \
"LaTeX Help" \
{(-} \
[documentsSubmenu] \
[pageLayoutSubmenu] \
[sectioningSubmenu] \
]
}
proc latexHelp {menu item} {
global HOME
edit -r "$HOME:Help:LaTeX Help"
}
proc laTeXPalette {} {
global latexMenu
float -m $latexMenu -n LaTeX -M -1 -z TeX
}
# Return the text submenus as a hierarchical submenu (for the short menu):
proc getTextSubsubmenus {} {
set m [getTextSubmenus]
set mm [list menu -M TeX -n {Text Submenus} -m $m]
return [list $mm]
}
# Return the math submenus as a hierarchical submenu (for the short menu):
proc getMathSubsubmenus {} {
set m [getMathSubmenus]
set mm [list menu -M TeX -n {Math Submenus} -m $m]
return [list $mm]
}
# Return the text submenus:
proc getTextSubmenus {} {
return [list \
[textStyleSubmenu] \
[textSizeSubmenu] \
[internationalSubmenu] \
[environmentsSubmenu] \
[boxesSubmenu] \
[miscellaneousSubmenu] \
]
}
# Return the math submenus:
proc getMathSubmenus {} {
return [list \
[mathModeSubmenu] \
[mathStyleSubmenu] \
[mathEnvironmentsSubmenu] \
[formulasSubmenu] \
[greekSubmenu] \
[binaryOperatorsSubmenu] \
[relationsSubmenu] \
[arrowsSubmenu] \
[dotsSubmenu] \
[symbolsSubmenu] \
[functionsSubmenu] \
[largeOperatorsSubmenu] \
[delimitersSubmenu] \
[mathAccentsSubmenu] \
[groupingSubmenu] \
[spacingSubmenu] \
]
}
#############################################################################
#
# Submenu definitions
#
#############################################################################
# Return the "Typeset" submenu. If the current document belongs
# to a TeX fileset, display the base filename throughout.
#
proc typesetSubmenu {} {
global mode
set currentWin [lindex [winNames -f] 0]
if { $currentWin == "" } {
return [minimalTypesetSubmenu]
} elseif { $mode == "TeX" } {
set currentDoc [file tail $currentWin]
# Process an untitled window:
if { [set num [winUntitled]] } {
if { $num > 1 } { set currentDoc "Untitled$num" }
# fall through
}
} else {
return [minimalTypesetSubmenu]
}
# set currentWin [lindex [winNames -f] 0]
# if { $currentWin == "" } {
# return [minimalTypesetSubmenu]
# } else {
# set currentDoc [file tail $currentWin]
# # Process an untitled window:
# if { [set num [winUntitled]] } {
# if { $num > 1 } { set currentDoc "Untitled$num" }
# # fall through
# } else {
# set ext [file extension $currentWin]
# if { [lsearch -exact {.tex .ltx .dtx .ins} $ext] < 0 } {
# return [minimalTypesetSubmenu]
# }
# }
# }
set docBasename [file rootname $currentDoc]
set projBasename $docBasename
set currentProj [isWindowInFileset $currentWin "tex"]
if { $currentProj != "" } {
set currentDoc [file tail [texFilesetBaseName $currentProj]]
set docBasename [file rootname $currentDoc]
}
# Determine which menu items are dimmed:
foreach ext {DVI PS AUX IDX Selection} { set prefix$ext "" }
# if { [findAuxiliaryFile DVI] == "" } {
# set prefixDVI "("
# }
# if { [findAuxiliaryFile PS] == "" } {
# set prefixPS "("
# }
# if { [findAuxiliaryFile AUX] == "" } {
# set prefixAUX "("
# }
# if { [findAuxiliaryFile IDX] == "" } {
# set prefixIDX "("
# }
# if { ![isSelection] } {
# set prefixSelection "("
# }
return [list menu -M TeX -n Typeset -m -p typesetSubmenuFilter [list \
[list /TTypeset $currentDoc] \
[list <U<O/V${prefixDVI}View "$docBasename\.dvi"] \
[list <U<O/P${prefixDVI}Print "$docBasename\.dvi"] \
"(-" \
{<U<O/TTypeset Clipboard} \
[list ${prefixSelection}Typeset Selection] \
"(-" \
[list <S${prefixPS}Open "$docBasename\.ps"] \
[list <S${prefixDVI}dvips "$docBasename\.dvi"] \
[list ${prefixPS}View "$docBasename\.ps"] \
[list ${prefixPS}Print "$docBasename\.ps"] \
"(-" \
[list <SOpen "$docBasename\.bbl"] \
[list <S${prefixAUX}bibtex "$docBasename\.aux"] \
[list <E<SOpen "$docBasename\.ind"] \
[list <S${prefixIDX}makeindex "$docBasename\.idx"] \
"(-" \
[typesetOtherFilesSubmenu $docBasename $projBasename] \
"(-" \
{Remove Auxiliary Files…} \
{Remove Temporary Files} \
]
]
}
proc minimalTypesetSubmenu {} {
return [list menu -M TeX -n Typeset -m -p typesetSubmenuFilter [list \
[list /TTypeset…] \
"(-" \
{<U<O/TTypeset Clipboard} \
{Typeset Selection} \
]
]
}
# Return a submenu of LaTeX auxiliary files with basename $basename1,
# except for the .aux file whose primary basename is $basename2.
#
proc typesetOtherFilesSubmenu { basename1 basename2 } {
return [list menu -M TeX -n {Other Files} -m -p typesetSubmenuFilter [list \
[list Open "$basename1\.log"] \
[concat <SOpen "$basename1\.aux "] \
[concat <SOpen "$basename2\.aux"] \
[list Open "$basename1\.toc"] \
[list Open "$basename1\.lof"] \
[list Open "$basename1\.lot"] \
[list Open "$basename1\.idx"] \
"(-" \
[list Open "$basename1\.blg"] \
[list Open "$basename1\.ilg"] \
"(-" \
{<U<O/OOpen Any TeX File…} \
]
]
}
proc typesetSubmenuFilter {submenu item} {
switch -regexp $item {
{Typeset Selection} {set func "typesetSelection"}
{Typeset Clipboard} {set func "typesetClipboard"}
"Typeset.*" {set func "typeset"}
"View.*\.dvi$" {set func {doTypesetCommand view DVI}}
"Print.*\.dvi$" {set func {doTypesetCommand print DVI}}
"dvips.*\.dvi$" {set func {doTypesetCommand dvips DVI}}
"View.*\.ps$" {set func {doTypesetCommand view PS}}
"Print.*\.ps$" {set func {doTypesetCommand print PS}}
"bibtex.*" {set func {doTypesetCommand bibtex AUX}}
"makeindex.*" {set func {doTypesetCommand makeindex IDX}}
"Open.*\.ps$" {set func {doTypesetCommand open PS}}
"Open.*\.bbl$" {set func {doTypesetCommand open BBL}}
"Open.*\.ind$" {set func {doTypesetCommand open IND}}
"Open.*\.log$" {set func {doTypesetCommand open LOG}}
"Open.*\.aux$" {set func {doTypesetCommand open AUX 1}}
"Open.*\.aux $" {set func {doTypesetCommand open AUX}}
"Open.*\.toc$" {set func {doTypesetCommand open TOC}}
"Open.*\.lof$" {set func {doTypesetCommand open LOF}}
"Open.*\.lot$" {set func {doTypesetCommand open LOT}}
"Open.*\.idx$" {set func {doTypesetCommand open IDX}}
"Open.*\.blg$" {set func {doTypesetCommand open BLG}}
"Open.*\.ilg$" {set func {doTypesetCommand open ILG}}
{Open Any TeX File} {set func "openAnyTeXFile"}
{Remove Auxiliary Files} {set func "removeAuxiliaryFiles"}
{Remove Temporary Files} {set func "removeTemporaryFiles"}
default {set func $item}
}
eval $func
}
# Return the "Goto" submenu:
proc gotoSubmenu {} {
return {menu -M TeX -n Goto -m -p gotoSubmenuFilter {
"<U/SLaTeX"
"BibTeX"
"MakeIndex"
"(-"
{/cNext Tab Stop}
{<U/cPrev Tab Stop}
{<B/cnth Tab Stop…}
"(-"
{Next Command}
{Prev Command}
{Next Command Select}
{Prev Command Select}
{Next Command Select With Args}
{Prev Command Select With Args}
"(-"
{Next Environment}
{Prev Environment}
{Next Environment Select}
{Prev Environment Select}
"(-"
{Next Section}
{Prev Section}
{Next Section Select}
{Prev Section Select}
{Next Subsection}
{Prev Subsection}
{Next Subsection Select}
{Prev Subsection Select}
}
}
}
proc gotoSubmenuFilter {submenu item} {
switch $item {
"LaTeX" {set func "latex"}
"BibTeX" {set func "bibtex"}
"MakeIndex" {set func "makeindex"}
{Next Tab Stop} {set func "nextTabStop"}
{Prev Tab Stop} {set func "prevTabStop"}
{nth Tab Stop} {set func "nthTabStop"}
{Next Command} {set func "nextCommand"}
{Prev Command} {set func "prevCommand"}
{Next Command Select} {set func "nextCommandSelect"}
{Prev Command Select} {set func "prevCommandSelect"}
{Next Command Select With Args} {set func "nextCommandSelectWithArgs"}
{Prev Command Select With Args} {set func "prevCommandSelectWithArgs"}
{Next Environment} {set func "nextEnvironment"}
{Prev Environment} {set func "prevEnvironment"}
{Next Environment Select} {set func "nextEnvironmentSelect"}
{Prev Environment Select} {set func "prevEnvironmentSelect"}
{Next Section} {set func "nextSection"}
{Prev Section} {set func "prevSection"}
{Next Section Select} {set func "nextSectionSelect"}
{Prev Section Select} {set func "prevSectionSelect"}
{Next Subsection} {set func "nextSubsection"}
{Prev Subsection} {set func "prevSubsection"}
{Next Subsection Select} {set func "nextSubsectionSelect"}
{Prev Subsection Select} {set func "prevSubsectionSelect"}
default {set func $item}
}
eval $func
}
# Return the "LaTeX Utilities" submenu:
proc latexUtilitiesSubmenu {} {
return {menu -M TeX -n {LaTeX Utilities} -m -p latexUtilsSubmenuFilter {
{<U<O/CChoose Command…}
"(-"
{<I/cInsert Literal Tab}
{Insert Tab Stop}
"(-"
{<O/cDelete Tab Stops}
{Delete Comments}
"(-"
{Convert Quotes}
{Convert Dollar Signs}
"(-"
{Short LaTeX Menu}
}
}
}
proc latexUtilsSubmenuFilter {submenu item} {
switch $item {
{Choose Command} {set func {chooseCommand [getLaTeXMenu]}}
{Insert Literal Tab} {set func "insertLiteralTab"}
{Insert Tab Stop} {set func "insertTabStop"}
{Insert Reference} {set func "insertReference"}
{Delete Tab Stops} {set func "deleteTabStops"}
{Delete Comments} {set func "deleteComments"}
{Convert Quotes} {set func "convertQuotes"}
{Convert Dollar Signs} {set func "convertDollarSigns"}
{Short LaTeX Menu} {set func "toggleLaTeXMenus"}
default {set func $item}
}
eval $func
}
# Return the "Documents" submenu:
proc documentsSubmenu {} {
return [list menu -M TeX -n Documents -m -p documentsSubmenuFilter [list \
{<U<O/NNew Document…} \
[insertDocumentSubmenu] \
"(-" \
"options…" \
"<B<I/Uusepackage" \
[packagesSubmenu] \
"(-" \
"filecontents…" \
{filecontents All} \
"(-" \
{Rebuild Documents Submenu} \
]
]
}
proc insertDocumentSubmenu {} {
return {menu -M TeX -n {Insert Document} -m -p documentsSubmenuFilter {
"article"
"report"
"book"
"letter"
"slides"
"other…"
}
}
}
proc documentsSubmenuFilter {submenu item} {
switch $item {
{New Document} {set func "newLaTeXDocument"}
{article} {set func "articleDocumentclass"}
{report} {set func "reportDocumentclass"}
{book} {set func "bookDocumentclass"}
{letter} {set func "letterDocumentclass"}
{slides} {set func "slidesDocumentclass"}
{other} {set func "otherDocumentclass"}
{usepackage} {insertPackage ""; return}
{filecontents All} {set func "filecontentsAll"}
{Rebuild Documents Submenu} {
global packagesSubmenuItems
set packagesSubmenuItems ""
message "Rebuilding the Documents submenu…"
eval [documentsSubmenu]
message ""
return
}
default {set func $item}
}
eval $func
}
proc packagesSubmenu {} {
global TeXmodeVars
if { $TeXmodeVars(buildPkgsSubmenu) } {
global packagesSubmenuItems
if { ![info exists packagesSubmenuItems] || $packagesSubmenuItems == "" } {
global latexPackages
set folders [buildTeXSearchPath 0]
# See DblClickAux.tcl for the definition of 'buildSubMenu':
set packagesSubmenuItems \
[buildSubMenu $folders "Packages" packageFilter latexPackages ".sty"]
}
return $packagesSubmenuItems
} else {
# if { [info exists packagesSubmenuItems] } {
catch {unset packagesSubmenuItems}
# }
return ""
}
}
proc packageFilter {submenu pkgName} {
global latexPackages
# See latexMacros.tcl for definition of 'insertPackage':
insertPackage [file tail [file rootname $latexPackages($submenu:$pkgName)]]
}
# Return the "Page Layout" submenu:
proc pageLayoutSubmenu {} {
return {menu -M TeX -n {Page Layout} -m {
"maketitle"
"(-"
"abstract"
"titlepage"
"(-"
"pagestyle…"
"thispagestyle…"
"pagenumbering…"
"(-"
"twocolumn"
"onecolumn"
}
}
}
# Return the "Sectioning" submenu:
proc sectioningSubmenu {} {
return {menu -M TeX -n Sectioning -m {
"part"
"chapter"
"section"
"subsection"
"subsubsection"
"paragraph"
"subparagraph"
"(-"
"appendix"
}
}
}
# Return the "Text Style" submenu:
proc textStyleSubmenu {} {
return {menu -M TeX -n {Text Style} -m {
"<S<B<I/Eemph"
"<S<U<B<I/Eem"
"<B<O/Uunderline"
"(-"
"<Supshape"
"<Stextup"
"<E<S<B<I/Itextit"
"<S<U<B<I/Iitshape"
"<E<S<B<I/Stextsl"
"<S<U<B<I/Sslshape"
"<E<S<B<I/Htextsc"
"<S<U<B<I/Hscshape"
"(-"
"<Smdseries"
"<Stextmd"
"<E<S<B<I/Btextbf"
"<S<U<B<I/Bbfseries"
"(-"
"<S<B<I/Rtextrm"
"<S<U<B<I/Rrmfamily"
"<E<S<B<I/Wtextsf"
"<S<U<B<I/Wsffamily"
"<E<S<B<I/Ytexttt"
"<S<U<B<I/Yttfamily"
"(-"
"<Snormalfont"
"<Stextnormal"
}
}
}
# Return the "Text Size" submenu:
# proc textSizeSubmenu {} {
# return {menu -M TeX -n {Text Size} -m {
# "<B<I/1tiny"
# "<B<I/2scriptsize"
# "<B<I/3footnotesize"
# "<B<I/4small"
# "<B<I/5normalsize"
# "<B<I/6large"
# "<B<I/7Large"
# "<B<I/8LARGE"
# "<B<I/9huge"
# "<B<I/0Huge"
# }
# }
# }
proc textSizeSubmenu {} {
return {menu -M TeX -n {Text Size} -m -p textSizeSubmenuFilter {
"<B<I/1tiny"
"<B<I/2scriptsize"
"<B<I/3footnotesize"
"<B<I/4small"
"<B<I/5normalsize"
"<B<I/6large"
"<B<I/7Large"
"<B<I/8LARGE"
"<B<I/9huge"
"<B<I/0Huge"
}
}
}
proc textSizeSubmenuFilter {menu item} {
$item
}
proc internationalSubmenu {} {
return {menu -M TeX -n International -m -p internatSubmenuFilter {
{ò}
{ó}
{ô}
{ö}
{õ}
"(-"
{ç}
{œ}
{æ}
{å}
{ø}
"(-"
{Ç}
{Œ}
{Æ}
{Å}
{Ø}
"(-"
{ß}
{¡}
{¿}
}
}
}
proc internatSubmenuFilter {menu item} {
$item
}
# Return the "Environments" submenu:
proc environmentsSubmenu {} {
return {menu -M TeX -n Environments -m {
"<I/kitemize…"
"<U<I/kenumerate…"
"<B<I/kdescription…"
"thebibliography…"
"(-"
"<I/lslide"
"<U<I/loverlay"
"<B<I/lnote"
"(-"
"<I/mfigure"
"<U<I/mtable"
"<B<I/mtabular…"
"(-"
"<I/nverbatim"
"<U<I/nquote"
"<B<I/nquotation"
"verse"
"(-"
"<I/ocenter"
"<U<I/oflushleft"
"<B<I/oflushright"
"(-"
"<I/pgeneral…"
}
}
}
# Return the "Boxes" submenu:
proc boxesSubmenu {} {
return {menu -M TeX -n Boxes -m {
"<B<I/Mmbox"
"makebox"
"fbox"
"framebox"
"(-"
"newsavebox"
"sbox"
"savebox"
"usebox"
"(-"
"raisebox"
"(-"
"parbox"
"minipage"
"(-"
"rule"
}
}
}
# Return the "Miscellaneous" submenu:
proc miscellaneousSubmenu {} {
return {menu -M TeX -n Miscellaneous -m -p miscSubmenuFilter {
"<B<I/Vverb"
"<B<I/Ffootnote"
{<B<I/Nmarginal note}
"(-"
"<B<I/Llabel"
"<B<I/Xref"
"<B<I/Ppageref"
"<B<I/Ccite"
"<U<B<I/Cnocite"
"(-"
"<B<I/Jitem"
"(-"
"<B<I/'quotes"
{<U<B<I/'double quotes}
"(-"
"!…ellipsis"
"!–en-dash"
"!—em-dash"
{TeX logo}
{LaTeX logo}
{LaTeX2e logo}
"date"
"(-"
"!†dag"
"ddag"
{!§section mark}
{!¶paragraph mark}
"!©copyright"
"!£pounds"
}
}
}
proc miscSubmenuFilter {submenu item} {
switch $item {
{marginal note} {set func "marginalNote"}
"item" {set func "insertItem"}
{double quotes} {set func "dblQuotes"}
"ellipsis" {set func "ldots"}
{TeX logo} {set func "texLogo"}
{LaTeX logo} {set func "latexLogo"}
{LaTeX2e logo} {set func "latex2eLogo"}
"date" {set func "today"}
{section mark} {set func "sectionMark"}
{paragraph mark} {set func "paragraphMark"}
default {set func $item}
}
eval $func
}
# Return a "Math Modes" submenu (called below and in latexKeys.tcl):
proc mathModeSubmenu {} {
global TeXmodeVars
if {$TeXmodeVars(useDollarSigns)} then {
bind '4' <zc> texMath "TeX"
bind '4' <zoc> texDisplaymath "TeX"
return {menu -M TeX -n {Math Modes} -m -p mathModeSubmenuFilter {
{<B<O/MTeX math}
{<B<I<O/MTeX displaymath}
"(-"
{LaTeX math}
{LaTeX displaymath}
}
}
} else {
bind '4' <zc> latexMath "TeX"
bind '4' <zoc> latexDisplaymath "TeX"
return {menu -M TeX -n {Math Modes} -m -p mathModeSubmenuFilter {
{TeX math}
{TeX displaymath}
"(-"
{<B<O/MLaTeX math}
{<B<I<O/MLaTeX displaymath}
}
}
}
}
proc mathModeSubmenuFilter {submenu item} {
switch $item {
{TeX math} {set func "texMath"}
{TeX displaymath} {set func "texDisplaymath"}
{LaTeX math} {set func "latexMath"}
{LaTeX displaymath} {set func "latexDisplaymath"}
default {set func $item}
}
eval $func
}
# Return the "Math Style" submenu:
proc mathStyleSubmenu {} {
return {menu -M TeX -n {Math Style} -m {
"<B<I<O/Imathit"
"<B<I<O/Rmathrm"
"<B<I<O/Bmathbf"
"<B<I<O/Wmathsf"
"<B<I<O/Ymathtt"
"<B<I<O/Cmathcal"
"(-"
"<B<I<O/Ddisplaystyle"
"<B<I<O/Ttextstyle"
"<B<I<O/Sscriptstyle"
"scriptscriptstyle"
}
}
}
# Return the "Math Environments" submenu:
proc mathEnvironmentsSubmenu {} {
return {menu -M TeX -n {Math Environments} -m -p mathEnvsSubmenuFilter {
"<I/imath"
"(-"
"<U<I/idisplaymath"
"<B<I/iequation"
"(-"
"<U<I/jeqnarray*…"
"<B<I/jeqnarray…"
"(-"
"<I/jarray…"
"(-"
"<I/pgeneral…"
}
}
}
proc mathEnvsSubmenuFilter {submenu item} {
switch $item {
"array" {set func "myArray"}
"eqnarray\*" {set func "eqnarrayStar"}
default {set func $item}
}
eval $func
}
# Return the "Formulas" submenu:
proc formulasSubmenu {} {
return {menu -M TeX -n Formulas -m -p formulasSubmenuFilter {
"subscript"
"superscript"
"(-"
"<B<O/Ffrac"
{<B<O/Rsqrt}
{nth root}
"(-"
{<B<O/1one parameter…}
{<B<O/2two parameters…}
}
}
}
proc formulasSubmenuFilter {submenu item} {
switch $item {
{frac} {set func "fraction"}
{sqrt} {set func "squareRoot"}
{nth root} {set func "nthRoot"}
{one parameter} {set func "oneParameter"}
{two parameters} {set func "twoParameters"}
default {set func $item}
}
eval $func
}
# Return the "Greek" submenu:
proc greekSubmenu {} {
return {menu -M TeX -n Greek -m {
"alpha"
"beta"
"<SGamma"
"<Sgamma"
"<E<SDelta"
"<Sdelta"
"epsilon"
"zeta"
"eta"
"<STheta"
"<Stheta"
"iota"
"kappa"
"<SLambda"
"<Slambda"
"mu"
"nu"
"<SXi"
"<Sxi"
"omicron"
"<SPi"
"<Spi"
"rho"
"<SSigma"
"<Ssigma"
"tau"
"<SUpsilon"
"<Supsilon"
"<E<SPhi"
"<Sphi"
"chi"
"<SPsi"
"<Spsi"
"<E<SOmega"
"<Somega"
"(-"
"varepsilon"
"vartheta"
"varpi"
"varrho"
"varsigma"
"varphi"
}
}
}
# Return the "Binary Operators" submenu:
proc binaryOperatorsSubmenu {} {
return {menu -M TeX -n {Binary Operators} -m {
"!±pm"
"mp"
"times"
"!÷div"
"ast"
"star"
"circ"
"bullet"
"cdot"
"cap"
"cup"
"uplus"
"sqcap"
"sqcup"
"vee"
"wedge"
"setminus"
"(-"
"diamond"
"bigtriangleup"
"bigtriangledown"
"triangleleft"
"triangleright"
"lhd"
"rhd"
"unlhd"
"unrhd"
"(-"
"oplus"
"ominus"
"otimes"
"oslash"
"odot"
"(-"
"bigcirc"
"dagger"
"ddagger"
"amalg"
"wr"
}
}
}
# Return the "Relations" submenu:
proc relationsSubmenu {} {
return {menu -M TeX -n Relations -m -p relationsSubmenuFilter {
"<S!≥geq"
"<S!≤leq"
"<E<Ssucc"
"<Sprec"
"<E<Ssucceq"
"<Spreceq"
"<E<S!»gg"
"<S!«ll"
"<E<Ssupset"
"<Ssubset"
"<E<Ssupseteq"
"<Ssubseteq"
"<E<Ssqsupset"
"<Ssqsubset"
"<E<Ssqsupseteq"
"<Ssqsubseteq"
"<E<Sni"
"<Sin"
"<E<Sdashv"
"<Svdash"
"(-"
"equiv"
"sim"
"simeq"
"asymp"
"!≈approx"
"cong"
"!≠neq"
"doteq"
"propto"
"(-"
"models"
"perp"
"mid"
"parallel"
"bowtie"
"join"
"smile"
"frown"
}
}
}
proc relationsSubmenuFilter {submenu item} {
switch $item {
{join} {set func "myJoin"}
{ll} {set func "myLl"}
default {set func $item}
}
eval $func
}
# Return the "Arrows" submenu:
proc arrowsSubmenu {} {
return {menu -M TeX -n Arrows -m -p arrowsSubmenuFilter {
"<SLeftarrow"
"<Sleftarrow"
"<E<SRightarrow"
"<Srightarrow"
"<E<SLeftrightarrow"
"<Sleftrightarrow"
"<E<SLongleftarrow"
"<Slongleftarrow"
"<E<SLongrightarrow"
"<Slongrightarrow"
"<E<SLongleftrightarrow"
"<Slongleftrightarrow"
"(-"
"<SUparrow"
"<Suparrow"
"<E<SDownarrow"
"<Sdownarrow"
"<E<SUpdownarrow"
"<Supdownarrow"
"(-"
"mapsto"
"longmapsto"
"leadsto"
"(-"
"leftharpoonup"
"rightharpoonup"
"leftharpoondown"
"rightharpoondown"
"rightleftharpoons"
"hookleftarrow"
"hookrightarrow"
"nearrow"
"searrow"
"swarrow"
"nwarrow"
}
}
}
proc arrowsSubmenuFilter {submenu item} {
$item
}
# Return the "Dots" submenu:
proc dotsSubmenu {} {
return {menu -M TeX -n Dots -m {
"bullet"
"cdot"
"(-"
"ldots"
"cdots"
"vdots"
"ddots"
}
}
}
# Return the "Symbols" submenu:
proc symbolsSubmenu {} {
return {menu -M TeX -n Symbols -m {
"aleph"
"hbar"
"imath"
"jmath"
"ell"
"wp"
"Re"
"Im"
"mho"
"(-"
"angle"
"backslash"
"bot"
"emptyset"
"exists"
"forall"
"!∞infty"
"nabla"
"!¬neg"
"!∂partial"
"prime"
"!√surd"
"top"
"(-"
"Box"
"Diamond"
"triangle"
"clubsuit"
"diamondsuit"
"heartsuit"
"spadesuit"
"(-"
"flat"
"natural"
"sharp"
}
}
}
# Return the "Functions" submenu:
proc functionsSubmenu {} {
return {menu -M TeX -n Functions -m {
"arccos"
"arcsin"
"arctan"
"arg"
"cos"
"cosh"
"cot"
"coth"
"csc"
"deg"
"det"
"dim"
"exp"
"gcd"
"hom"
"inf"
"ker"
"lg"
"<B<O/Llim"
"liminf"
"limsup"
"ln"
"log"
"max"
"min"
"Pr"
"sec"
"sin"
"sinh"
"sup"
"tan"
"tanh"
"(-"
"bmod"
"pmod"
}
}
}
# Return the "Large Operators" submenu:
proc largeOperatorsSubmenu {} {
return {menu -M TeX -n {Large Operators} -m {
"<B<O/Ssum"
"<B<O/Pprod"
"coprod"
"<B<O/Iint"
"oint"
"(-"
"bigcup"
"bigcap"
"bigsqcup"
"bigvee"
"bigwedge"
"bigodot"
"bigotimes"
"bigoplus"
"biguplus"
}
}
}
# Return the "Delimiters" submenu:
proc delimitersSubmenu {} {
return {menu -M TeX -n Delimiters -m -p delimitersSubmenuFilter {
"parentheses"
"brackets"
"braces"
{vertical bars}
{other delims…}
"(-"
{half-open interval}
{half-closed interval}
"(-"
{<Smulti-line big parentheses}
{<Sbig parentheses}
{<E<Smulti-line big brackets}
{<Sbig brackets}
{<E<Smulti-line big braces}
{<Sbig braces}
{<E<Smulti-line big vertical bars}
{<Sbig vertical bars}
{<E<Sother multi-line big delims…}
{<Sother big delims…}
"(-"
{<Smulti-line big left brace}
{<Sbig left brace}
{<E<Sother multi-line mixed big delims…}
{<Sother mixed big delims…}
}
}
}
proc delimitersSubmenuFilter {submenu item} {
switch $item {
{vertical bars} {set func "absoluteValue"}
{other delims} {set func "otherDelims"}
{half-open interval} {set func "half-openInterval"}
{half-closed interval} {set func "half-closedInterval"}
{big parentheses} {set func "bigParens"}
{multi-line big parentheses} {set func "multiBigParens"}
{big brackets} {set func "bigBrackets"}
{multi-line big brackets} {set func "multiBigBrackets"}
{big braces} {set func "bigBraces"}
{multi-line big braces} {set func "multiBigBraces"}
{big vertical bars} {set func "bigAbsValue"}
{multi-line big vertical bars} {set func "multiBigAbsValue"}
{other big delims} {set func "otherBigDelims"}
{other multi-line big delims} {set func "otherMultiBigDelims"}
{big left brace} {set func "bigLeftBrace"}
{multi-line big left brace} {set func "multiBigLeftBrace"}
{other mixed big delims} {set func "otherMixedBigDelims"}
{other multi-line mixed big delims} {set func "otherMultiMixedBigDelims"}
default {set func $item}
}
eval $func
}
# Return the "Math Accents" submenu:
proc mathAccentsSubmenu {} {
return {menu -M TeX -n {Math Accents} -m {
"<B<O/Aacute"
"<B<O/Bbar"
"breve"
"<B<O/Ccheck"
"<B<O/Ddot"
"ddot"
"<B<O/Ggrave"
"<B<O/Hhat"
"<B<O/Ttilde"
"<B<O/Vvec"
"(-"
"widehat"
"widetilde"
"(-"
"imath"
"jmath"
}
}
}
# Return the "Grouping" submenu:
proc groupingSubmenu {} {
return {menu -M TeX -n Grouping -m {
"<B<O/Uunderline"
"<B<O/Ooverline"
"<B<I<O/Uunderbrace"
"<B<I<O/Ooverbrace"
"(-"
"overrightarrow"
"overleftarrow"
"(-"
"stackrel"
}
}
}
# Return the "Spacing" submenu:
proc spacingSubmenu {} {
return {menu -M TeX -n Spacing -m -p spacingSubmenuFilter {
{neg thin}
"thin"
"medium"
"thick"
"(-"
"quad"
"qquad"
"(-"
"hspace"
"vspace"
"(-"
"hfill"
"vfill"
"(-"
"smallskip"
"medskip"
"bigskip"
}
}
}
proc spacingSubmenuFilter {submenu item} {
switch $item {
{neg thin} {set func "negThin"}
default {set func $item}
}
eval $func
}